<!--
 * @Author: taoke
 * @Date: 2022-05-17 16:58:51
 * @LastEditors: taoke
 * @LastEditTime: 2022-05-17 17:43:39
 * @Description: 
 * @FilePath: \yunying-sys-cli4\src\components\partner\order\deliverGoodsDialog.vue
-->
<template>
  <el-dialog
    title="确认"
    :visible.sync="visible"
    width="25%"
    :before-close="handleClose"
  >
    <el-form
      ref="ruleForm"
      :rules="rules"
      :model="formInline"
      label-width="100px"
    >
      <el-form-item label="快递公司" prop="expressCompany">
        <el-input
          v-model="formInline.expressCompany"
          placeholder="请输入快递公司"
          clearable
        >
        </el-input>
      </el-form-item>
      <el-form-item label="快递号" prop="expressNumber">
        <el-input
          v-model="formInline.expressNumber"
          placeholder="请输入快递号"
          clearable
        >
        </el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="confirm">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'deliverGoodsDialog',
  data() {
    return {
      visible: false,
      row: {},
      formInline: {
        expressCompany: '',
        expressNumber: ''
      },
      rules: {
        expressCompany: [
          { required: true, message: '请输入快递公司', trigger: 'blur' }
        ],
        expressNumber: [
          { required: true, message: '请输入快递号', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    show(row) {
      this.row = row
      this.visible = true
      this.$nextTick(() => {
        this.$refs.ruleForm.resetFields()
        this.$refs.ruleForm.clearValidate()
      })
    },
    handleClose(done) {
      done()
    },
    confirm() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          this.visible = false
          this.$emit('confirm', this.row, this.formInline)
        } else {
          return false
        }
      })
    }
  }
}
</script>
<style scoped></style>
